from matplotlib import pyplot as plt
import numpy as np

data = np.loadtxt('err.csv', dtype = np.float64)
print(data)

x = data[:, 0]
y = data[:, 1]
h = 2 / x
err = data[:, 2]

figure = plt.figure()
# plt.subplot(1, 3, 1)
# plt.xlabel('n')
# plt.ylabel('err')
# plt.plot(x, err) 
# plt.subplot(1, 3, 2)
# plt.xlabel('log(n)')
# plt.ylabel('err')
# plt.plot(np.log2(x), err)
# plt.subplot(1, 3, 3)
plt.xlabel('log10(h)',fontsize = 14)
plt.ylabel('log10(err)',fontsize = 14)
plt.plot(np.log10(h), np.log10(err),'-bx')
plt.show()


